<template>
	<view style="margin: 30rpx 30rpx 30rpx 30rpx; font-size: 35rpx;">
		<u-toast ref="uToast" />
		<view>
			<view style="border-style: solid; border-width:2px; border-color: #FFFFFF #FFFFFF #dddddd #FFFFFF;">
				<view style="color: #5d6063;margin-bottom: 10rpx;">
					关于
				</view>
			</view>

			<view style="padding: 5rpx 5rpx 5rpx 5rpx ;">
				<view style="margin-top: 20rpx;">
					意见反馈
				</view>
				<u-divider :use-slot="false" border-color="#bfc4cb" half-width="375" style="margin-top: 25rpx;" />
				<view style="margin-top: 20rpx;">
					隐私政策
				</view>
				<u-divider :use-slot="false" border-color="#bfc4cb" half-width="375" style="margin-top: 25rpx;" />
				<view style="margin-top: 20rpx;">
					服务条款
				</view>
				<u-divider :use-slot="false" border-color="#bfc4cb" half-width="375" style="margin-top: 25rpx;" />
				<view style="margin-top: 20rpx;">
					关于产品
				</view>
				<u-divider :use-slot="false" border-color="#bfc4cb" half-width="375" style="margin-top: 25rpx;" />
				<view style="margin-top: 20rpx;">
					检查更新
				</view>
				<u-divider :use-slot="false" border-color="#bfc4cb" half-width="375" style="margin-top: 25rpx;" />
			</view>
		</view>

		<view style="margin-top: 40rpx;" v-if="isLogin">
			<u-button type="error" :plain="true" :ripple="true" ripple-bg-color="#909399" @click="userLogout">退出登陆</u-button>
			<!-- <button@tap="userLogout">退出登陆</button> -->
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				isLogin: false,
			}
		},
		methods: {
			userLogout() {
				uni.clearStorage();

				this.toast("退出登陆", 4)

				setTimeout(() => {
					uni.switchTab({
						url: 'account'
					});
				}, 1000)
			},
		},
		onShow() {
			let that = this;

			uni.getStorage({
				key: 'userName',
				success: function(res) {
					// console.log(res.data)
					that.isLogin = true;
				},
				fail: function(res) {
					// console.log("未登陆")
					that.isLogin = false;
				}
			});
		},
	}
</script>

<style scoped>

</style>
